﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace ContentManager
{
    public partial class StartForm : Form
    {
        private DisclaimValue disclaim;
               
        public StartForm(ref DisclaimValue disclaim)
        {
            this.disclaim = disclaim;
            InitializeComponent();
        }

        private void Agree_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void Disclaim_Click(object sender, EventArgs e)
        {
            this.disclaim.Value = true;
            this.Close();
        }

        private void StartForm_Load(object sender, EventArgs e)
        {
            this.LoadText();
        }

        private void LoadText()
        {
            try
            {
                System.Text.Encoding enc = System.Text.Encoding.GetEncoding(1252);
                System.IO.StreamReader sr = new System.IO.StreamReader("Readme.txt", enc);
                this.ReadmeTextBox.Text = sr.ReadToEnd();
                sr.Close();
            }
            catch
            {
                this.ReadmeTextBox.Text = ContentManager.Properties.Resources.NoWarranty;                                
            }
        }
    }
}
